package com.example.demo.model.service;

import com.example.demo.model.mapper.UserMapper;
import com.example.demo.model.valueObject.UserLogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    //根据id查找用户
    public UserLogin getUserById(String id)
    {
        return userMapper.getUserById(id);
    }
    //注册新用户
    public void userRegist(UserLogin userLogin)
    {
        userMapper.userRegist(userLogin);
    }
    //重置用户密码(12345678)
    public void resetUserPassword(String id)
    {
        userMapper.resetUserPassword(id);
    }
    //更改密码
    void changePassword(UserLogin userLogin)
    {
        userMapper.changePassword(userLogin);
    }
}
